package com.aduerr.v1shouyin.mvp.activity;

import android.content.Intent;
import android.os.Bundle;
import androidx.appcompat.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import com.aduerr.v1shouyin.R;
import com.aduerr.v1shouyin.common.Constants;
import com.aduerr.v1shouyin.unioncard.UnionTranscationRecordActivity;
import com.aduerr.v1shouyin.util.ToastUtils;
import com.orhanobut.hawk.Hawk;


/**
 * @author HI
 * @email dev1024@foxmail.com
 * @time 2018/10/18 17:19
 * @change
 * @chang time
 * @class describe
 */

public class OrderActivity extends AppCompatActivity {

    @BindView(R.id.tv_title)
    TextView tvTitle;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_order);
        ButterKnife.bind(this);
        tvTitle.setText("订单查询");
    }

    @OnClick({R.id.img_back, R.id.ll_scan, R.id.ll_vip, R.id.ll_bank, R.id.ll_cash,
            R.id.ll_scan_pre, R.id.ll_vip_charge})
    void clicked(View v) {
        switch(v.getId()) {
            case R.id.ll_scan:
                startActivity(new Intent(this, ScanOrderActivity.class));
                break;
            case R.id.img_back:
                finish();
                break;
            case R.id.ll_vip:
                startActivity(new Intent(this, MemberConsumeRecordActivity.class));
                break;
            case R.id.ll_bank:
                if(Hawk.get(Constants.IS_ACTIVE, false)) {
                    startActivity(new Intent(OrderActivity.this,
                            UnionTranscationRecordActivity.class));
                } else {
                    ToastUtils.showToast(this, "银联功能未激活，请联系运营");
                }
                break;
            case R.id.ll_cash:
                startActivity(new Intent(this, CashOrderActivity.class));
                break;
            case R.id.ll_scan_pre:
                startActivity(new Intent(this, PreAuthoOrderRecord.class));
                break;
            case R.id.ll_vip_charge:
                startActivity(new Intent(this, MemberChargeRecordActivity.class));
                break;
        }
    }
}
